package com.dopies.bsdmall.activity;

import org.json.JSONObject;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.dopies.BeeFramework.activity.BaseActivity;
import com.dopies.bsdmall.R;
import com.dopies.bsdmall.adapter.HelpListAdapter;
import com.dopies.bsdmall.model.HelpModel;
import com.dopies.bsdmall.model.ProtocolConst;
import com.external.androidquery.callback.AjaxStatus;



public class HelpListActivity extends BaseActivity
{
    HelpModel dataModel;
    ListView helpListView;
    HelpListAdapter listAdapter;
    private TextView title;
    private ImageView back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.help_list);

        helpListView = (ListView)findViewById(R.id.help_listview);
        dataModel = new HelpModel(this);
        dataModel.fetchShopHelp();
        listAdapter = new HelpListAdapter(this,dataModel);
        helpListView.setAdapter(listAdapter);

        back = (ImageView) findViewById(R.id.top_view_back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                finish();
            }
        });

        title = (TextView) findViewById(R.id.top_view_text);
        title.setText(R.string.help);

    }
    public void OnMessageResponse(String url, JSONObject jo, AjaxStatus status)
    {
        if(url.endsWith(ProtocolConst.SHOPHELP))
        {
            listAdapter.notifyDataSetChanged();
        }
    }
   
}
